package cn.javastudy.spring._01_依赖注入.service;

import cn.javastudy.spring._01_依赖注入.dao.UserDAO;

/**
 * 用户服务
 *
 * @author sumou
 * @date 2025/02/18
 */
public class UserService {

    private UserDAO userDAO;

    public UserService() {
        System.out.println("userService无参构造");
    }

    public void setUserDAO1(UserDAO userDAO) {
        System.out.println("userDAO通过set方法注入");
        this.userDAO = userDAO;
    }

    public void save() {
        this.userDAO.insert();
    }

}
